package xnj.lazydog.btcontroller;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

import xnj.lazydog.btcontroller.Bluetooth.BlueToothMaster;

//BlueTooth.BlueToothMaster;

public class BlueToothService extends Service {

    public static BlueToothMaster blueToothMaster;

    public class  MyBinder extends Binder
    {
        public BlueToothMaster getBTMaster(BlueToothMaster.BlueToothEventListener listener)
        {
            blueToothMaster = new BlueToothMaster(BlueToothService.this,listener);
            return blueToothMaster;
        }
    }
    public MyBinder myBinder = new MyBinder();
    @Override
    public void onCreate() {
        super.onCreate();
        Log.w("SERVICE","created");
    }

    @Override
    public IBinder onBind(Intent intent) {
        Log.w("SERVICE","binded");
        return myBinder;
    }


    @Override
    public void onDestroy() {

        blueToothMaster.onDestroy(this);
        super.onDestroy();
    }
}
